/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package collision;

import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.ImageIcon;
import javax.swing.JPanel;

/**
 *
 * @author iRina
 */
public class InFrame extends JPanel{


    
    private String name;// = "/Sprites/template.gif";
    private int finished;
    private Image image;
    
    /*### Finished Values ####
     * finished = 1 -> enter game;
     * finished = 2 -> end game;
     * finished = 3 -> back to menu;
     */
    
    public InFrame(int a, int b){
        finished = 0;
    }
    
    public InFrame(){
        //setSize(640,470);
        setFocusable(false);
        //setBackground(Color.BLACK);
        //setDoubleBuffered(true);
        //setVisible(true);
        
        finished = 0;
        
       // ImageIcon ii = new ImageIcon(this.getClass().getResource(name));
       // image = ii.getImage();

    }
    
    public InFrame(String nameXD){
        setSize(640,470);
        //setFocusable(true);
        //setBackground(Color.BLACK);
        //setDoubleBuffered(true);
        //setVisible(true);
        
    	this.name = nameXD;
        finished = 0;
        
        ImageIcon ii = new ImageIcon(this.getClass().getResource(name));
        image = ii.getImage();

    }
    
    
    @Override
    public void paint(Graphics g) {
        super.paint(g);
        
        Graphics2D g2d = (Graphics2D)g;
            
        g2d.drawImage(this.getImage(), 0, 0, this);
        
       Toolkit.getDefaultToolkit().sync();
       g.dispose();
        
    }
    
    public void setImage(Image image) {
        this.image = image;
    }

    public Image getImage() {
        return image;
    }
        
    public int getFinished() {
        return finished;
    }

    public void setFinished(int finished) {
        this.finished = finished;
    }
    
}
